package com.heima.user.feign;

import com.heima.api.feign.ApUserFeignClient;
import com.heima.model.user.pojo.ApUser;
import com.heima.user.service.ApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @Author mr.zhao
 * @Date 2025/6/27 20:27
 */
@RestController
public class UserClient implements ApUserFeignClient {
	/**
	 * 根据用户id获取用户实体
	 *
	 * @param userId
	 * @return
	 */
	@Autowired
	private ApUserService apUserService;

	@Override
	@GetMapping("/init/api/v1/user/{id}")
	public ApUser one(@PathVariable("id") Integer id) {
		return apUserService.getById(id);
	}
}
